跳到主要内容

5.1.3-connection-flow-designer

5.1.3 Connection Flow Designer

Users will access to the designer interface after the connection flow is successfully created. The designer mainly consists of four areas: Node menu, canvas design, property settings, and Operations.

Node Menu: Perform operations and configure nodes on the canvas.

  • Undo: Undo the previous operation. (Supports a maximum of 10 steps)
  • Redo: Redo the last undone operation. (Supports a maximum of 10 steps)
  • Delete: 1. Delete selected nodes; 2. "Start" and "End" nodes cannot be deleted.
  • Alignment: Align selected nodes. Supports vertical center alignment and horizontal center alignment.
  • Execution Node: 1. A node for executing interface events; 2. Can execute integration platform interfaces (Including conversion interfaces) and APIs of this system.
  • Conversion Node: 1. A node for converting output parameters; 2. Can convert output parameters from preceding nodes; 3. Functionally similar to steps in the conversion interface.
  • Conditional Branch: Set conditions for process flow.
  • Loop Node: Add sub processes to iterate through array parameters for synchronized multi-data operations.
  • Assignment Node: Assign values to process variables in main or sub processes for temporary storage of processed data, which can be called by other nodes.

Canvas Design Area: Users can customize the layout and execution sequence of nodes in the connection flow.

Property Settings: Node property refers to the functions of each function node; process property refers to variables settings for current process. Select the node, and the corresponding functions will be displayed on the right menu for users to configure.

Click blank area on the canvas to view process variables settings.

Portal Diagram

Click the setting icon to access the process variables setting pop-up, add variable fields, and set initial value information:

Operations: This area allows: Simulation run, basic settings copy and save.

Simulation Run: Execute the current connection flow to check if it performs as designed. The simulation run interface varies depending on the type of connection flow.

  • Scheduled Task Simulation Run: Select the scheduled task to execute.
  • Manual Trigger Task Simulation Run: Execute directly if there are no input parameters; otherwise, execute with input parameter information.
  • Listener Event Simulation Run: Execute based on the input parameters returned by the listener event.

Basic Settings: Set the basic information of the connection flow, allowing modifications to specific fields.

  • When disabling the connection flow, a confirmation pop-up saying: If disabled, business process flows will not be allowed and calls from other business modules will not be supported. Confirm to disable?
  • When enabling the connection flow, a confirmation pop-up saying: If enabled, business process flows will be allowed and calls from other business modules will be supported. Confirm to enable?

Copy: Click the "Copy" button to open the basic information editing pop-up. Edit the information of the copied flow (The name of the copied flow should not be the same as the one of the current flow). Click "Confirm" to copy the current flow as a new one.

Save: Save the settings of the current connection flow.

5.1.3.1 Start Node - Scheduled Task Type

Create a connection flow with the type of "Scheduled Task". Access to the designer where "Start" and "End" nodes are added by default.

Click the "Start" node, and the corresponding settings will be displayed on the right menu. Users can configure the information by clicking the "Add" button to open the editing pop-up, where users can edit the name, code, status and methods. The scheduled task type provides two options: Common Method and Cron Expression.

  • Common Method: Set the execution frequency and time, e.g., execute once daily at 00:00:00.
  • Cron Expression: Set the expression formula, e.g., 0 */1 * * * ? to execute once per minute.

After editing the scheduled task, return to the designer interface. The updated information of "Start" node will be displayed on the right menu, and the information can be modified and deleted.

5.1.3.2 Start Node - Listener Design Type

Create a connection flow with the type of "Listener Event". Access to the designer where "Start" and "End" nodes are added by default.

The event listener start node supports two event types: Event Definition and Built-in Event. Event Definition data comes from events added in Event Management-Event Definition, while Built-in Event data comes from Event Management-Built-in Events (system API interfaces provided by other business platforms). Switching event types does not clear the start event, and the system preserves the parameters configured for the other event type.

If there is interface input parameter information, users can see a "View Parameter Information" button under the selected Event Definition or Built-in Event. Click it to view the details of the interface's input parameters.

Data Filtering: Data filtering enables defining filter conditions for the output parameters of the current node using formulas, utilizing the capabilities of the formula definer. Click the "+" icon to open the formula definer editing pop-up.

5.1.3.3 Start Node - Manual Trigger Type

Create a connection flow with the type of "Manual Trigger". Access to the designer where "Start" and "End" nodes are added by default.

Users can choose to define input parameters under Manual Trigger start node can define input parameters according to actual need. Click the setting icon under Input Parameter Settings to open the setting pop-up:

There are three ways to configure parameters: Custom Parameter Settings, Import Parameters, and Extract Parameters.

Custom Parameter Settings: Users can configure parameters as "No Input Parameter" or "Single Input Parameter" as well as other settings according to actual need.

Click the "Import Parameters" button to open the system interface pop-up, select an interface from the integration platform, and return the interface parameters to the input parameter settings list.

Click the "Extract Parameters" button to open the parameter extraction pop-up, edit the JSON script, and click Extract Parameter to acquisite parameter information from the script into the input parameter settings list.

5.1.3.4 Start Node - Webhook Type

Create a connection flow with the type of "Webhook". Access to the designer where "Start" and "End" nodes are added by default.

Click the "Start" node, and the corresponding settings will be displayed on the right menu. Click Input Parameter Settings to open the setting pop-up. Body parameters, Query parameters, Header parameters, and Cookie parameters are supported.

After setting the parameters, select an authentication method. There are three authentication methods: Custom, system, and no authentication required.

  • Custom Authentication: Users can customize their identity verification filtering method according to actual need.
  • System Authentication: Uses the MK system, authenticated by authentication management method of API service.
  • No Authentication Required: Allows anonymous access.

After completing the start node configuration, click "Save" to confirm your changes. The corresponding Webhook connection flow API interface information will be automatically added to API service category of this system.

5.1.3.5 Execution Node

An execution node defines specific business process events. Its execution events come from integration interfaces (Including conversion interfaces), internal or external system APIs. Each node supports only one execution event at a time.

Click the execution node, then click the input box under "Execution Action" to access the interface selection pop-up. The supported action types include connection flow, Open API of this system, internal API of this system, event publishing, and integration interfaces.

After selecting an interface, users can see a "View Execution Action Parameters" button, click the button to view details.

After confirming the execution action, users can also see "Parameter Mapping" on the right menu. The system provides two parameter mapping methods: Parameter Mapper and Formula Definer.

Click the parameter mapper to access the mapping pop-up, select the fields to be mapped, and drag them to the target fields to establish the association.

  1. The input parameter mapper of the execution node mainly defines the node's input parameter rules, using a visual editor to configure input parameters via drag-and-drop.
  2. Current mapping rules are:
    • String type can map all fields.
    • Numeric types can map strings, numeric values, integers, options, and dates.
    • Integer types can map strings, integers, numeric values, options, and dates.
    • Boolean can map strings and boolean.
    • Options can map strings, selections, numeric values, and integers.
    • Objects cannot map objects.
    • Numeric values cannot map any type.

Switch to the formula definer type, click the setting icon to access the formula definer editing pop-up. The default object assignment loads the parameter information, which requires matching and mapping. Set the parameters that need to be mapped, Click "Confirm" to save.

  1. All input parameters support defining via formulas and all the writing capabilities of formula.
  2. The input parameter mapping rules of the current node come from the output parameters of all preceding associated nodes, including the start node, not just from the directly connected nodes above.
  3. Not all nodes in the connection flow can be selected. Only the preceding nodes on the connection line are allowed to be selected, and unrelated nodes are not included in the selection range.

5.1.3.6 Conversion Node

The conversion node converts the output parameters of the preceding nodes. It is similar to writing a conversion function in the connector. For details, refer to interface conversion.

The data conversion of Conversion Node mainly converts input parameters by setting required parameter type through output parameters. Click "Output Parameter Settings" to access the editing pop-up.

Parameters in the output settings can be customized or configured by importing parameters, extracting parameters, or synchronizing context node parameters.

After completing the output parameter settings, parameter mapping configuration will be displayed in the right menu. The system provides two parameter mapping methods: Parameter Mapper and Formula Definer.

Click "Parameter Mapper" to access the mapping pop-up, select the fields to be mapped, and drag them to the target fields to establish the association.

  1. The input parameter mapper of the execution node mainly defines the node's input parameter rules, using a visual editor to configure input parameters via drag-and-drop.
  2. Current mapping rules are:
    • String type can map all fields.
    • Numeric types can map strings, numeric values, integers, options, and dates.
    • Integer types can map strings, integers, numeric values, options, and dates.
    • Boolean can map strings and boolean.
    • Options can map strings, selections, numeric values, and integers.
    • Objects cannot map objects.
    • Numeric values cannot map any type.

Switch to the formula definer type, click the setting icon to access the formula definer editing pop-up. The default object assignment loads the parameter information, which requires matching and mapping. Set the parameters that need to be mapped, Click "Confirm" to save.

  1. All input parameters support defining via formulas and all the writing capabilities of formula.
  2. The input parameter mapping rules of the current node also come from the output parameters of all preceding associated nodes, including the start node, not just from the directly connected nodes above.
  3. Not all nodes in the connection flow can be selected. Only the preceding nodes on the connection line are allowed to be selected, and unrelated nodes are not included in the selection range.

5.1.3.7 Conditional Branch Node

When setting up a conditional branch, first add a conditional branch node, then connect the next nodes related to form multiple branches. The system will automatically determine the flow direction based on the set branch conditions.

Condition settings provide two methods: Formula Definition and Matching Rules. Click the setting icon to access the conditional branch settings pop-up:

Portal Diagram

In "If Condition Settings", click the "+" icon to access the formula designer pop-up. Select the field to set corresponding conditions. Click "Confirm" to save.

Click "Matching Rules" to access the setting pop-up. Click the "+" icon to access the rule configuration pop-up. Select the field to match and set the passing conditions.

The conditional branch flow supports single-condition execution, where the process proceeds if the first condition is met, and other conditions in the same node are skipped. It also supports multi-condition execution, where all conditions in the current node branch are evaluated, and will execute once the conditions are met.

"Condition Mismatch Direction" is mainly used when all conditions fail to meet the rules. The default execution path prevents process interruption, ensuring the workflow can continue running. Nodes that can be selected are limited to the associated nodes under the conditional branch.

5.1.3.8 Loop Node

"Loop Node" is mainly used to traverse the numeric type of a loop object or multiple pieces of data in a connection flow and process or convert each piece of data.The node property consists of title, code, process variables, and loop method fields.

Process variables are used in loop nodes to store necessary parameter information during the execution of sub-processes. The result data of each variable can be acquisited solely and processed into the required parameter information for other nodes to call. Parameter fields can be added through Customize, Import Parameters, Extract Parameters, and Synchronize Above Node Parameters.

Custom Parameter Settings:

  1. When customizing parameters, users need to manually input the information, including: Parameter Name, Data Type and Note.
  2. Users can add parameters. If the added parameter type is "Object", users can expand it to add sub-node content. The added sub-nodes can be modified or deleted.

Import Parameters:

  1. When the protocol comes from a custom protocol, users can select an interface from existing interface declarations, and the input parameters from the selected interface will be automatically filled in.
  2. Imported parameters only fill in the input parameters and do not imply any association between the converted interface and the declared interface. Essentially, both are new interfaces.
  3. The filled parameters can be modified, and allows adjustments to Parameter Name, Data Type and Note.

Extract Parameters:

  1. Supports extracting parameter information from JSON and automatically filling in the input parameters.
  2. The extracted parameters can be modified or deleted.

Synchronize Above Node Parameters: Parameters from the above node can be synchronized into the current parameters, which can originate from an execution node or a transformation node.

Loop Method: Loop Node supports two loop methods: Array Traversal and Condition Loop. Array Traversal refers to perform loop execution of sub-processes through traversing each data in array traversal. Traversal times are decided by the number of array data. In "Loop Methods", select "Array Traversal", then click pull-down icon to view the node parameter options (Only acquisite node data precede the loop node as traversal conditions).

In "Loop Methods", select "Condition Loop", click the editing icon to accedd to the editing pop-up, and configure the condition parameter matching rules (Number of condition loops is decided by the number of data in Arrays that meets the specified conditions).

5.1.3.8.1 Sub-loop Node

The sub-process is the content executed by the loop node when traversing the loop array. After the process node is successfully added, a tree menu for all loop nodes will be added to the upper-right corner of the canvas. Users can click the node menu to enter the sub-process or return to the main process interface. Users can also double-click the loop node to enter the sub-process interface. "Start" and "End" nodes are added by default on sub-process canvas.

The "Start" and "End" nodes in the loop sub-process are used solely to mark the beginning and end of the process, and do not involve any input or output parameter settings.

(The sub-process design is essentially the same as the main process design. Users can add corresponding node configurations to implement the required functionality.)

5.1.3.9 Assignment Node

Assignment Node is mainly used to assign the output parameter data of the node to process variable parameters for storage during the execution of the main process or loop sub-process, allowing other nodes to call it through the process variables. When adding an assignment node to the process, corresponding settings include title, Code, and assignment rule will be displayed on the right menu.

Assignment Rule Setting: Click the edit icon to access the editing pop-up.

The assignment object only supports selecting process variable fields. Click the input box under "Variables" to expand the options. After selecting a field, click the input box under "Rules" to access the editing pop-up. Set the required parameter source, then click "Save".

5.1.3.10 Transaction Node

Transaction Node is mainly for users to handle the anomalous node through other solutions in order to ensure smooth flow of the whole business process. Corresponding settings include title, code, process variables and anomaly termination will be displayed on the right menu.

Corresponding Settings Instruction:

  • Title: Title for connection flow node, used to name and distinguish the node from others.
  • Code: The unique identifier of the connection flow node. Can be edited during creation but cannot be edited after saving.
  • Anomaly Handling: Determines whether the connection flow continues or terminates when anomaly occurs in the connection flow.
  • Process Variables: Set the variable parameters required for the transaction process and regression in the transaction node for business node to call. Process variables can be added manually, imported from interface parameters, extracted from script parameters, or synchronized from the parameters of other nodes.

After setting the process variables for a transaction node, the initial parameter values must be configured. Assignment methods include simple rules and custom formula in formula editor.

Simple Rules: Assignments can acquisite returned values from other nodes as initial variable values using null values, fixed values, or application variables.

Formula Editor: Use the capabilities of the public component formula editor to set parameter values as initial variable values.

Double-click the transaction node to access the design interface. It jumps to the transaction workflow by default. Users can switch between node interfaces using the transaction node navigation panel on the left.

5.1.3.10.1 Transaction Process

Transaction Process mainly configures the standard process content for transactions. The configuration method aligns with that of the connection process. The canvas of Transaction Process is displayed by default.

5.1.3.10.2 Regression

Regression mainly configures business processes to be executed in the event of anomaly at transaction nodes. Click "Regression" to access the corresponding design canvas.

5.1.3.10.3 Transaction Node Scenarios

Scenario: In the shopping process, when a user completes payment based on the total purchase amount, funds are transferred from the user's account to the merchant's account. If the merchant fails to receive the payment due to an exception and the user's account has already been debited, the transaction must be canceled, and the funds must be returned to the user's account.

Implementation steps:

Step 1: First, the low-code platform requires corresponding user accounts, merchant accounts, and shopping list forms. Access the MK system's low-code platform and create a new application named "Shopping Transfer Application."

Go to the application management backend, create a new form titled "Shopping List Form." In the form design, add fields for username, merchant name, and transaction amount (the total value from the summary table). Add a detail table control with fields for item name, quantity, unit price, and total price. Save and publish.

Create a new user account form. In the form design, add fields for username and account balance, then save and publish the form.

Create a new merchant account form. In the form design, add fields for the merchant name and account balance, then save and publish.

Step 2: Enter the integration platform backend management, click on the system management menu, select "Create New" under the custom system to establish a "Shopping Transfer Transaction System," then proceed to the system configuration backend.

In the Interface Management - Connection Service List, add three JDBC database connection services corresponding to the low-code forms for querying the shopping list, user account balance, and merchant account balance.

After completing the connection service setup, open the interface declaration list and add JDBC query interfaces and amount modification interfaces for the shopping list, user accounts, and merchant accounts.

Add a shopping list interface to the interface list to query the payment amount, user, and merchant name information in the shopping list.

Add JDBC interface declarations for querying and modifying user balances to the interface list.

Add JDBC interface declarations for querying and modifying merchant balances to the interface list.

Step 3: After completing the interface declaration configuration, navigate to the Integration Platform's Business Orchestration module, click on Connection Flow Management, and create a new "Shopping Transfer Transaction Process" connection flow in the list.

Enter the connection flow design interface, select the start node, drag in an execution node (Query Shopping List node), and drag in a transaction node (Transfer Transaction Process). Complete the wiring, confirm, and save.

Add parameters "User Name" and "Merchant Name" to the start node as inputs, which will be used as input conditions for querying user and merchant balances later.

The execution node is set to select the query shopping list interface, with the input parameter associated with the shopping user name. The shopping list details are obtained through the execution node, providing information on the shopping user, the selling merchant, and the required payment amount.

Click the transaction node, set the process variables, and record the user name, merchant name, and payment amount retrieved by the execution node for use as input parameters in the transaction and rollback processes. Add a variable to temporarily store the amount.

Double-click the transaction node to enter the transaction process design interface, add an execution node, set the action to select the query user account debit interface, and store the obtained user balance in the temporary storage amount variable using the assignment node.

During the assignment node process, subtract the payment amount from the queried user balance and use the result as the variable value.

Add an execution action, select the update user balance interface declaration, and use the calculated variable result as the update value to modify the user balance.

After completing the user account deduction, proceed to configure the merchant account payment process by adding an execution node. Select the "Query Merchant Account Balance" interface as the execution action to retrieve the merchant account balance.

Use an assignment node to add the payment amount to the merchant balance and assign it to the temporary storage variable.

Add an execution action, select the interface declaration for updating the merchant account balance, and update the calculated process variables to the merchant account to complete the payment process.

Step 4: After completing the transaction process configuration, click the rollback process menu to enter the rollback process design interface. The rollback process is triggered when a transaction node encounters an exception. In this scenario, if the merchant fails to receive payment, the deducted amount from the user's account must be refunded.

Add an execution node in the rollback process to query the user's current account balance (the transaction node has already deducted the amount, so the queried amount reflects the post-deduction balance).

Add an assignment node to store the payment amount plus the queried user balance after payment as a variable in the process variables through the assignment node.

Add an execution node, select the 'Update User Account Interface Declaration', and update the variable result from the assignment calculation to the user's balance to complete the refund operation.

Step 5: After completing the connection flow configuration, run the low-code homepage to add initial amounts for users and merchants: ¥1000 for users and ¥5000 for merchants; then add a shopping record with a payment amount of ¥300.

After setting the initial values, execute the connection flow. If the transaction process runs normally, the rollback process will not be triggered, allowing the user's payment to be deducted and the merchant to receive the funds as normal. Execute the connection flow with input parameters:

The connection flow runs successfully. The logs show that the transaction process executes normally without triggering the rollback process.

The user and merchant account balances in the low-code form have been successfully updated accordingly:

If the transaction node encounters an exception, the logs will show that the rollback process was triggered, and the user's payment will be refunded.

The user and merchant balances in the low-code form will not be updated.

5.1.3.11 End Node

The end node is where the connection flow closes. It is added by default when the connection flow is created. Users can configure the output parameters of the end node to determine whether the execution result meets requirements or to verify if key data is correct.

Click the edit icon to access the editing pop-up. The output parameter settings provide options for users to customize output parameters, import parameters, extract parameters, or synchronize preceding or latter node parameters. Custom settings allow manual configuration for no output parameters or single output parameter fields.

Parameters in the output settings can be customized or configured by importing parameters, extracting parameters, or synchronizing preceding or latter node parameters.

Extraction Format: Supports extracting parameter information from JSON to auto-fill the input parameters. Extracted parameters can be modified or deleted.

Synchronize Parameters from Preceding Nodes: Parameters from preceding nodes can be synchronized into the current parameters. Preceding nodes can be Execution Node and Conversion Node.

After completing the output parameter settings, mapping configurations will be displayed on the right menu. The system provides two mapping methods: the Parameter Mapper and the Formula Definer.

Click "Parameter Mapper" to access the mapping pop-up, select the fields to be mapped, and drag them to the target fields to establish the association.

Switch to "Formula Definer", click the edit icon to access the editing pop-up. Display Object Assignment and the corresponding information by default. Set parameters that need to be mapped, then click "Confirm" to save.